package gitee

import "time"

type Issue struct {
	ID               int64            `json:"id"`
	URL              string           `json:"url"`
	RepositoryURL    string           `json:"repository_url"`
	LabelsURL        string           `json:"labels_url"`
	CommentsURL      string           `json:"comments_url"`
	HTMLURL          string           `json:"html_url"`
	ParentURL        interface{}      `json:"parent_url"`
	Number           string           `json:"number"`
	ParentID         int64            `json:"parent_id"`
	Depth            int64            `json:"depth"`
	State            string           `json:"state"`
	Title            string           `json:"title"`
	Body             string           `json:"body"`
	User             User             `json:"user"`
	Labels           []IssueLabel     `json:"labels"`
	Assignee         User             `json:"assignee"`
	Collaborators    []User           `json:"collaborators"`
	Repository       Repository       `json:"repository"`
	Milestone        MileStone        `json:"milestone"`
	CreatedAt        time.Time        `json:"created_at"`
	UpdatedAt        time.Time        `json:"updated_at"`
	PlanStartedAt    time.Time        `json:"plan_started_at"`
	Deadline         time.Time        `json:"deadline"`
	FinishedAt       time.Time        `json:"finished_at"`
	ScheduledTime    int64            `json:"scheduled_time"`
	Comments         int64            `json:"comments"`
	Priority         int64            `json:"priority"`
	IssueType        string           `json:"issue_type"`
	Program          interface{}      `json:"program"`
	SecurityHole     bool             `json:"security_hole"`
	IssueState       string           `json:"issue_state"`
	Branch           string           `json:"branch"`
	IssueTypeDetail  IssueTypeDetail  `json:"issue_type_detail"`
	IssueStateDetail IssueStateDetail `json:"issue_state_detail"`
}

type IssueLabel struct {
	ID           int64     `json:"id"`
	Color        string    `json:"color"`
	Name         string    `json:"name"`
	RepositoryID int64     `json:"repository_id"`
	URL          string    `json:"url"`
	CreatedAt    time.Time `json:"created_at"`
	UpdatedAt    time.Time `json:"updated_at"`
}

type Enterprise struct {
	ID      int64  `json:"id"`
	Type    string `json:"type"`
	Name    string `json:"name"`
	Path    string `json:"path"`
	HTMLURL string `json:"html_url"`
}

type ProjectLabels struct {
	ID    int64  `json:"id"`
	Name  string `json:"name"`
	Ident string `json:"ident"`
}

type IssueTypeDetail struct {
	ID        int64     `json:"id"`
	Title     string    `json:"title"`
	Template  string    `json:"template"`
	Ident     string    `json:"ident"`
	Color     string    `json:"color"`
	IsSystem  bool      `json:"is_system"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type IssueStateDetail struct {
	ID        int64     `json:"id"`
	Title     string    `json:"title"`
	Color     string    `json:"color"`
	Icon      string    `json:"icon"`
	Command   string    `json:"command"`
	Serial    int64     `json:"serial"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type IssueComment struct {
	ID          int64       `json:"id"`
	Body        string      `json:"body"`
	User        User        `json:"user"`
	Source      interface{} `json:"source"`
	Target      Target      `json:"target"`
	CreatedAt   time.Time   `json:"created_at"`
	UpdatedAt   time.Time   `json:"updated_at"`
	InReplyToID int64       `json:"in_reply_to_id,omitempty"`
}

type CommentIssueInfo struct {
	ID     int64  `json:"id"`
	Title  string `json:"title"`
	Number string `json:"number"`
}

type Target struct {
	Issue       CommentIssueInfo `json:"issue"`
	PullRequest interface{}      `json:"pull_request"`
}
